<script setup lang="ts">
import {evaluationOutcome} from "@/api/home/login/login";
import {reactive,ref} from "vue";
import router from "@/router";

const data = reactive({
    studentId: localStorage.getItem('studentId'),
    pageSize: 100,
    pageNum: 1
})
const tableData= ref([])
evaluationOutcome(data).then(res => {
    console.log(res)
tableData.value = res.rows
})
const jump = (obj)=>{
    router.push({path:'/result',query:{score:obj.score,analysis:obj.analysis}})
}
</script>

<template>
    <div class="box">
        <div class="head">
            <router-link to="/personal">
                <van-icon name="arrow-left" size=4vw style="margin-top: 2%;margin-left: 2%"/>
                <label>测评记录</label>
            </router-link>

        </div>
        <div class="foot">
            <div v-for="item in tableData" :key="item" @click="jump(item)">
                <van-cell center :title="item.analysis" :value='item.score' :label="item.createTime"/>
            </div>
        </div>
    </div>
</template>

<style scoped>
* {
    margin: 0;
    padding: 0;
}
a {
    color:#333333;
}
.box {
    width: 100%;
    height: 100vh;
    background-color: #f8f8f8;

    .head {
        width: 100%;
        height: 7vh;
        background-color: white;
        margin-bottom: 3%;

        label {
            margin-left: 3%;
            font-size: 1%;
            font-weight: 700;
        }
    }

    .foot {
        > div {
            margin: auto;
            margin-bottom: 2%;
            width: 95%;

            > div {
                padding: 2% 3%;

            :deep(.van-cell__title){
                width: 80%;
            }
            }
        }
    }
}

:deep(.van-cell__title) {
    font-weight: 600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
}

:deep(.van-cell__value) {
    color: black;
    font-weight: bold;
}
</style>